#ifndef __COMMANDS_H__
#define __COMMANDS_H__

#include "ScriptEditor.h"
//--------------------------------------------------------------------------------------------------
/// Starts a script
//--------------------------------------------------------------------------------------------------
#define SCRIPT_START( name )		void name(IXMLWriter* xml, IAttributes* attr)
/// Adds a script to a level
#define ADD_SCRIPT(script)			functionList.insert(#script, script )
/// add a level 
///<param>* level 
#define ADD_LEVEL(level)			levelList.insert(#level, level)
//Sets position of an object
#define SetPosition(ObjectId, PositionX, PositionY, PositionZ)				\
	   _SetPosition(ObjectId, vector3df(PositionX,PositionY,PositionZ), xml, attr)

#define SetRotation(ObjectId, RotationX, RotationY, RotationZ, RotationW)	\
	   _SetRotation(ObjectId, quaternion(RotationX, RotationY, RotationZ, RotationW), xml, attr)

#define SetScale(ObjectId, ScaleX, ScaleY, ScaleZ)				\
	   _SetScale(ObjectId, vector3df(ScaleX,ScaleY,ScaleZ), xml, attr)

#define MoveToPosition(ObjectId, PositionX, PositionY, PositionZ , Speed)	\
	   _MoveToPosition(ObjectId, vector3df(PositionX, PositionY, PositionZ) , Speed , xml, attr)

#define MoveToObject(ObjectId, DestObject , Speed)							\
	   _MoveToObject(ObjectId, DestObject , Speed , xml, attr)

//#define MoveToPositionWithSpeed(ObjectId, Speed, PositionX, PositionY, PositionZ) \
//	   _MoveToPositionWithSpeed(ObjectId, Speed, vector3df(PositionX, PositionY, PositionZ), xml, attr)

//#define MoveToEntityWithSpeed(ObjectId, Speed, DestObject) \
//	   _MoveToEntityWithSpeed(ObjectId, Speed, DestObject, xml, attr)

#define KillObject(ObjectId)			_KillObject(ObjectId, xml, attr)

#define MoveEnemyToPosition(EnemyId, EnemyState, PositionX, PositionY, PositionZ) \
	   _MoveEnemyToPosition(EnemyId, EnemyState, vector3df(PositionX, PositionY, PositionZ), xml, attr)

#define MoveEnemyToObject(EnemyId , EnemyState, DestObj) \
	    _MoveEnemyToObject(EnemyId , EnemyState, DestObj , xml , attr)

#define EnableAI(EnemyId)	_EnableAI(EnemyId , xml, attr)

#define DisableAI(EnemyId)	_DisableAI(EnemyId, xml, attr)

#define FreezeAI(EnemyId)	_FreezeAI(EnemyId, xml, attr)

#define StartEnemy(EnemyId)	_StartEnemy(EnemyId, xml, attr)

#define StopEnemy(EnemyId)	_StopEnemy(EnemyId, xml, attr)

#define FollowWayPoint(ObjectId , WayPointId , speed )	_FollowWayPoint(ObjectId , WayPointId , speed ,xml , attr)

#define End											_StopTest(xml , attr);

#define IfObjectInWayPoint(ObjectId, WayPointId)	_IfObjectInWayPoint(ObjectId , WayPointId,xml , attr);

#define IfObjectInPosition(ObjectId, PosX, PosY,PosZ)	_IfObjectInPosition(ObjectId , vector3df(PosX,PosY,PosZ),xml , attr);

#define IfAllEnemyDead()								_IfAllEnemyDead(xml , attr);

#define IfEnemyDead(EnemyId)							_IfEnemyDead(EnemyId , xml , attr);
///Enables the fog 
#define EnableFog()										_EnableFog(xml,attr)
///Disable the fog
#define DisableFog()									_DisableFog(xml,attr)
///Setup Fog
#define SetupFog( color , transitionTime , start , end ) _SetupFog( color , transitionTime , start , end , xml,attr)
///Reset Fog
#define ResetFog()										_ResetFog(xml,attr)
///Enable Trigger
#define EnableTrigger(triggerID)						_EnableTrigger(triggerID , xml , attr)
///Disable Trigger
#define DisableTrigger(triggerID)						_DisableTrigger(triggerID , xml , attr)
///Open Door
///s32 doorID
///bool keepOpen
#define OpenDoor(doorID , keepOpen)						_OpenDoor(doorID , keepOpen, xml , attr)
///Close Door
#define CloseDoor(doorID , keepClosed)					_CloseDoor(doorID , keepClosed, xml , attr)
///Delay
#define Delay(timeMS)									_Delay(timeMS, xml , attr)
///Sets the state of an enemy
#define SetEnemyState(EnemyId , State)					_SetEnemyState(EnemyId , State)
///End Level
#define EndLevel()										_EndLevel()

#define SetAnim(objectID , anim)						_SetAnim(objectID,anim)
#endif // __COMMANDS_H__